<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * @author Thuan Nguyen Dinh<dinhthuan229@gmail.com>
 * @copyright 2013
 */
class Post_model extends CI_Model
{
   public function get_post5($limit=""){    
  	$data = array();
  	$this->db->select('*');
  	$this->db->from('tbpost');
  	$this->db->where('type','1');
  	$this->db->where('status','1');
  	$this->db->order_by("time","desc");
  	$this->db->limit($limit);  	
  	$query = $this->db->get();
  	$data= $query->result_array();
  	return $data;  	
  }
  public function get_video($limit=""){    
  	$data = array();
  	$this->db->select('*');
  	$this->db->from('tbpost');
  	$this->db->where('type','2');
  	$this->db->where('status','1');
  	$this->db->order_by("time","desc");
  	$this->db->limit($limit);
  	$query = $this->db->get();
  	$data= $query->result_array();
  	return $data;  	
  }
}
?>
